
// 抽象动物类
abstract class Animal {
    protected String name;
    protected String species;
    protected String breed;
    protected double price;

    public Animal(String name, String species, String breed, double price) {
        this.name = name;
        this.species = species;
        this.breed = breed;
        this.price = price;
    }

    // 抽象方法，吃饭
    abstract void eat();

    // 抽象方法，睡觉
    abstract void sleep();

    // 抽象方法，玩
    abstract void play();

    // 抽象方法，叫
    abstract void makeSound();
}

// 猫类，继承自动物类
class Cat extends Animal {
    public Cat(String name, String species, String breed, double price) {
        super(name, species, breed, price);
    }

    @Override
    void eat() {
        System.out.println(name + " the cat is eating.");
    }

    @Override
    void sleep() {
        System.out.println(name + " the cat is sleeping.");
    }

    @Override
    void play() {
        System.out.println(name + " the cat is playing.");
        makeSound();
    }

    @Override
    void makeSound() {
        System.out.println("Meow!");
    }
}

// 狗类，继承自动物类
class Dog extends Animal {
    public Dog(String name, String species, String breed, double price) {
        super(name, species, breed, price);
    }

    @Override
    void eat() {
        System.out.println(name + " the dog is eating.");
    }

    @Override
    void sleep() {
        System.out.println(name + " the dog is sleeping.");
    }

    @Override
    void play() {
        System.out.println(name + " the dog is playing.");
    }

    @Override
    void makeSound() {
        System.out.println("Woof!");
    }
}

public class Main {
    public static void main(String[] args) {
        // 实例化两只猫
        Cat cat1 = new Cat("Kitty", "Cat", "Persian", 500.0);
        Cat cat2 = new Cat("Tom", "Cat", "Siamese", 400.0);

        // 实例化两只狗
        Dog dog1 = new Dog("Buddy", "Dog", "Labrador", 800.0);
        Dog dog2 = new Dog("Max", "Dog", "German Shepherd", 900.0);

        // 调用猫的方法
        cat1.eat();
        cat1.sleep();
        cat1.play();

        cat2.eat();
        cat2.sleep();
        cat2.play();

        // 调用狗的方法
        dog1.eat();
        dog1.sleep();
        dog1.play();
        dog1.makeSound();

        dog2.eat();
        dog2.sleep();
        dog2.play();
        dog2.makeSound();
    }
}